/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function login(){
    var target = document.getElementById('loginformcontent');
    if(target.innerHTML == ""){
        var form = document.createElement('form');
        form.setAttribute('name', 'loginform');
        form.setAttribute('method', 'post');
        form.setAttribute('action', 'Login');
        form.setAttribute('id', 'loginform')
        var inputuser = document.createElement('div');
        var labeluser = document.createElement('label');
        labeluser.innerHTML = "Username : ";
        inputuser.appendChild(labeluser);
        var inputtextuser = document.createElement('input');
        inputtextuser.id = 'loginuser';
        inputtextuser.setAttribute('type', 'text');
        inputtextuser.setAttribute('name', 'username');
        inputuser.appendChild(inputtextuser);
        var inputpass = document.createElement('div');
        var labelpass = document.createElement('label');
        labelpass.innerHTML = "Password : ";
        inputpass.appendChild(labelpass);
        var inputtextpass = document.createElement('input');
        inputtextpass.id = 'loginpass';
        inputtextpass.setAttribute('type', 'password');
        inputtextpass.setAttribute('name', 'password');
        inputpass.appendChild(inputtextpass);
        var submit = document.createElement('div');
        var submitbtn = document.createElement('input');
        submitbtn.setAttribute('type', 'submit');
        submitbtn.setAttribute('value', 'Sign In');
        submit.appendChild(submitbtn);
        submit.setAttribute('style', 'text-align:center');
        form.appendChild(inputuser);
        form.appendChild(inputpass);
        form.appendChild(submit);
        target.appendChild(form);
        var style = 'position: absolute; top: 65px; right: 185px; height: 75px;width: 300px;border-style: solid; border-color: #0a7094; border-width: 1px;';
        form.setAttribute('style', style)
        /*
        form.style.position = 'absolute';
        form.style.top = '65px';
        form.style.right = '185px';
        form.style.width = '250px';
        form.style.height = '100px';
        form.style.border = 'solid';
        form.style.borderwidth = '2px';
        form.style.border = '#0a7094';
        */
    }else{
        target.innerHTML = "";
    }
/*
    document.writeln('<form name="loginform" method="post" action="Login">')
    document.writeln('<div><h2>Login Authentication</h2></div>')
    document.writeln('<div><label>Username</label>')
    document.writeln('<input type="text" name="username" value="">')
    document.writeln('</div>')
    document.writeln('<div><label>Password</label>')
    document.writeln('<input type="password" name="password" value="">')
    document.writeln('</div>')
    document.writeln('<div><input type="submit" name="submit" value="Login"></div>')
    document.writeln('</form>')
    */
}